Linux 시스템 프로 그래 밍 상호 배척 량 (데이터 구조 보호) #include #include #include /* * , */ struct foo { int f_count; pthread_mutex_t f_lock; int f_id; }; struct foo* foo_alloc(int id)//allocate the object { struct foo* fp; if((fp = (struct foo*)malloc(sizeof(struct foo))) !... Linux 시스템 프로 그래 밍
상호 배척 량 (데이터 구조 보호) #include #include #include /* * , */ struct foo { int f_count; pthread_mutex_t f_lock; int f_id; }; struct foo* foo_alloc(int id)//allocate the object { struct foo* fp; if((fp = (struct foo*)malloc(sizeof(struct foo))) !... Linux 시스템 프로 그래 밍